```html
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Oracle数据库学习指南 - Scott用户表详解</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
            color: #333;
            background-color: #f8f9fa;
            line-height: 1.6;
        }
        .hero {
            background: linear-gradient(135deg, #6e8efb, #a777e3);
            color: white;
        }
        .table-card {
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }
        .table-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0,0,0,0.1);
        }
        .sql-code {
            font-family: 'Courier New', Courier, monospace;
            background-color: #f5f7fa;
            border-left: 4px solid #6e8efb;
        }
        .highlight {
            background-color: #fff8e1;
            padding: 2px 4px;
            border-radius: 3px;
        }
        .section-title {
            position: relative;
            padding-bottom: 10px;
        }
        .section-title:after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            width: 60px;
            height: 3px;
            background: linear-gradient(to right, #6e8efb, #a777e3);
        }
        .table-responsive {
            overflow-x: auto;
        }
    </style>
</head>
<body class="antialiased">
    <!-- Hero Section -->
    <section class="hero py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-6xl text-center">
            <h1 class="text-4xl md:text-5xl font-bold mb-6 font-serif">Oracle数据库学习指南</h1>
            <h2 class="text-2xl md:text-3xl mb-8 opacity-90">Scott用户表详解与SQL查询技巧</h2>
            <p class="text-xl max-w-3xl mx-auto opacity-90">
                本指南详细介绍Oracle经典Scott用户下的四张基础表，通过丰富的示例和可视化展示，帮助您快速掌握Oracle数据库的核心查询技术。
            </p>
        </div>
    </section>

    <!-- Main Content -->
    <div class="container mx-auto max-w-6xl px-4 py-12">
        <!-- Introduction Section -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 section-title">Scott用户介绍</h2>
            <div class="bg-white rounded-xl shadow-md p-6 mb-8">
                <p class="text-lg mb-6">
                    Scott用户是Oracle数据库内置的经典示例用户，包含四张基础表，是学习Oracle数据库的理想起点。
                </p>
                
                <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
                    <div class="table-card bg-white rounded-lg overflow-hidden shadow-md border border-gray-100">
                        <div class="p-6">
                            <div class="flex items-center mb-4">
                                <div class="w-12 h-12 rounded-full bg-red-100 flex items-center justify-center mr-4">
                                    <i class="fas fa-users text-red-500 text-xl"></i>
                                </div>
                                <h3 class="text-xl font-bold text-gray-800">员工表(EMP)</h3>
                            </div>
                            <p class="text-gray-600 mb-4">存储公司所有员工信息，包含员工编号、姓名、职位、工资等字段。</p>
                        </div>
                    </div>
                    
                    <div class="table-card bg-white rounded-lg overflow-hidden shadow-md border border-gray-100">
                        <div class="p-6">
                            <div class="flex items-center mb-4">
                                <div class="w-12 h-12 rounded-full bg-blue-100 flex items-center justify-center mr-4">
                                    <i class="fas fa-building text-blue-500 text-xl"></i>
                                </div>
                                <h3 class="text-xl font-bold text-gray-800">部门表(DEPT)</h3>
                            </div>
                            <p class="text-gray-600 mb-4">存储公司部门信息，包含部门编号、名称和位置信息。</p>
                        </div>
                    </div>
                    
                    <div class="table-card bg-white rounded-lg overflow-hidden shadow-md border border-gray-100">
                        <div class="p-6">
                            <div class="flex items-center mb-4">
                                <div class="w-12 h-12 rounded-full bg-green-100 flex items-center justify-center mr-4">
                                    <i class="fas fa-chart-line text-green-500 text-xl"></i>
                                </div>
                                <h3 class="text-xl font-bold text-gray-800">工资等级表(SALGRADE)</h3>
                            </div>
                            <p class="text-gray-600 mb-4">定义工资等级范围，包含等级编号、最低工资和最高工资。</p>
                        </div>
                    </div>
                    
                    <div class="table-card bg-white rounded-lg overflow-hidden shadow-md border border-gray-100">
                        <div class="p-6">
                            <div class="flex items-center mb-4">
                                <div class="w-12 h-12 rounded-full bg-purple-100 flex items-center justify-center mr-4">
                                    <i class="fas fa-money-bill-wave text-purple-500 text-xl"></i>
                                </div>
                                <h3 class="text-xl font-bold text-gray-800">工资补贴表(BONUS)</h3>
                            </div>
                            <p class="text-gray-600 mb-4">记录员工工资补贴信息，包含员工姓名、职位、基本工资和佣金。</p>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Table Structures Section -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 section-title">表结构详解</h2>
            
            <!-- DEPT Table -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-6 border-b border-gray-100 bg-gradient-to-r from-blue-50 to-blue-100">
                    <h3 class="text-2xl font-bold text-blue-700 flex items-center">
                        <i class="fas fa-table mr-3"></i>
                        部门表(DEPT)结构
                    </h3>
                </div>
                <div class="p-6">
                    <div class="table-responsive">
                        <table class="min-w-full divide-y divide-gray-200">
                            <thead class="bg-gray-50">
                                <tr>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">序号</th>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">字段名称</th>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">字段类型</th>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">描述</th>
                                </tr>
                            </thead>
                            <tbody class="bg-white divide-y divide-gray-200">
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap">1</td>
                                    <td class="px-6 py-4 whitespace-nowrap font-medium">DEPTNO</td>
                                    <td class="px-6 py-4 whitespace-nowrap">NUMBER</td>
                                    <td class="px-6 py-4 whitespace-nowrap">部门编号</td>
                                </tr>
                                <tr class="bg-gray-50">
                                    <td class="px-6 py-4 whitespace-nowrap">2</td>
                                    <td class="px-6 py-4 whitespace-nowrap font-medium">DNAME</td>
                                    <td class="px-6 py-4 whitespace-nowrap">VARCHAR2</td>
                                    <td class="px-6 py-4 whitespace-nowrap">部门名称</td>
                                </tr>
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap">3</td>
                                    <td class="px-6 py-4 whitespace-nowrap font-medium">LOC</td>
                                    <td class="px-6 py-4 whitespace-nowrap">VARCHAR2</td>
                                    <td class="px-6 py-4 whitespace-nowrap">部门位置</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            
            <!-- EMP Table -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-6 border-b border-gray-100 bg-gradient-to-r from-red-50 to-red-100">
                    <h3 class="text-2xl font-bold text-red-700 flex items-center">
                        <i class="fas fa-table mr-3"></i>
                        员工表(EMP)结构
                    </h3>
                </div>
                <div class="p-6">
                    <div class="table-responsive">
                        <table class="min-w-full divide-y divide-gray-200">
                            <thead class="bg-gray-50">
                                <tr>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">序号</th>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">字段名称</th>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">字段类型</th>
                                    <th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">描述</th>
                                </tr>
                            </thead>
                            <tbody class="bg-white divide-y divide-gray-200">
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap">1</td>
                                    <td class="px-6 py-4 whitespace-nowrap font-medium">EMPNO</td>
                                    <td class="px-6 py-4 whitespace-nowrap">NUMBER</td>
                                    <td class="px-6 py-4 whitespace-nowrap">员工编号</td>
                                </tr>
                                <tr class="bg-gray-50">
                                    <td class="px-6 py-4 whitespace-nowrap">2</td>
                                    <td class="px-6 py-4 whitespace-nowrap font-medium">ENAME</td>
                                    <td class="px-6 py-4 whitespace-nowrap">VARCHAR2</td>
                                    <td class="px-6 py-4 whitespace-nowrap">员工姓名</td>
                                </tr>
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap">3</td>
                                    <td class="px-6 py-4 whitespace-nowrap font-medium">JOB</td>
                                    <td class="px-6 py-4 whitespace-nowrap">VARCHAR2</td>
                                    <td class="px-6 py-4 whitespace-nowrap">职位</td>
                                </tr>
                                <tr class="bg-gray-50">
                                    <td class="px-6 py-4 whitespace-nowrap">4</td>
                                    <td class="px-6 py-4 whitespace-nowrap font-medium">MGR</td>
                                    <td class="px-6 py-4 whitespace-nowrap">NUMBER</td>
                                    <td class="px-6 py-4 whitespace-nowrap">员工领导编号</td>
                                </tr>
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap">5</td>
                                    <td class="px-6 py-4 whitespace-nowrap font-medium">HIREDATE</td>
                                    <td class="px-6 py-4 whitespace-nowrap">DATE</td>
                                    <td class="px-6 py-4 whitespace-nowrap">入职时间</td>
                                </tr>
                                <tr class="bg-gray-50">
                                    <td class="px-6 py-4 whitespace-nowrap">6</td>
                                    <td class="px-6 py-4 whitespace-nowrap font-medium">SAL</td>
                                    <td class="px-6 py-4 whitespace-nowrap">NUMBER</td>
                                    <td class="px-6 py-4 whitespace-nowrap">基本工资</td>
                                </tr>
                                <tr>
                                    <td class="px-6 py-4 whitespace-nowrap">7</td>
                                    <td class="px-6 py-4 whitespace-nowrap font-medium">COMM</td>
                                    <td class="px-6 py-4 whitespace-nowrap">NUMBER</td>
                                    <td class="px-6 py-4 whitespace-nowrap">奖金</td>
                                </tr>
                                <tr class="bg-gray-50">
                                    <td class="px-6 py-4 whitespace-nowrap">8</td>
                                    <td class="px-6 py-4 whitespace-nowrap font-medium">DEPTNO</td>
                                    <td class="px-6 py-4 whitespace-nowrap">NUMBER</td>
                                    <td class="px-6 py-4 whitespace-nowrap">员工所属部门编号</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </section>

        <!-- Example Queries Section -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 section-title">SQL查询示例</h2>
            
            <!-- Simple Queries -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-6 border-b border-gray-100 bg-gradient-to-r from-purple-50 to-purple-100">
                    <h3 class="text-2xl font-bold text-purple-700 flex items-center">
                        <i class="fas fa-search mr-3"></i>
                        基础查询
                    </h3>
                </div>
                <div class="p-6">
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">1. 查询所有员工数据</h4>
                        <div class="sql-code p-4 rounded mb-4">
                            <code>SELECT * FROM emp;</code>
                        </div>
                    </div>
                    
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">2. 投影查询 - 显示部分字段</h4>
                        <div class="sql-code p-4 rounded mb-4">
                            <code>SELECT empno, ename, job FROM emp;</code>
                        </div>
                    </div>
                    
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">3. 使用别名</h4>
                        <div class="sql-code p-4 rounded mb-4">
                            <code>SELECT empno AS "员工编号", ename AS "员工姓名", job AS "职位" FROM emp;</code>
                        </div>
                    </div>
                    
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">4. 去除重复内容</h4>
                        <div class="sql-code p-4 rounded mb-4">
                            <code>SELECT DISTINCT job FROM emp;</code>
                        </div>
                        <p class="text-gray-600 mt-2">
                            <span class="highlight">DISTINCT</span>的去重原理是以一行数据来判断的，如果两行数据中每列的数据都一样才叫重复，否则就是不重复
                        </p>
                    </div>
                </div>
            </div>
            
            <!-- Conditional Queries -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-6 border-b border-gray-100 bg-gradient-to-r from-green-50 to-green-100">
                    <h3 class="text-2xl font-bold text-green-700 flex items-center">
                        <i class="fas fa-filter mr-3"></i>
                        条件查询
                    </h3>
                </div>
                <div class="p-6">
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">1. 基本工资高于2000的员工</h4>
                        <div class="sql-code p-4 rounded mb-4">
                            <code>SELECT * FROM emp WHERE sal > 2000;</code>
                        </div>
                    </div>
                    
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">2. 工资范围在1500~3000(包含)的员工</h4>
                        <div class="flex flex-col md:flex-row gap-4">
                            <div class="flex-1">
                                <h5 class="text-lg font-medium mb-2 text-gray-600">方式一: AND条件</h5>
                                <div class="sql-code p-4 rounded">
                                    <code>SELECT * FROM emp WHERE sal >= 1500 AND sal <= 3000;</code>
                                </div>
                            </div>
                            <div class="flex-1">
                                <h5 class="text-lg font-medium mb-2 text-gray-600">方式二: BETWEEN</h5>
                                <div class="sql-code p-4 rounded">
                                    <code>SELECT * FROM emp WHERE sal BETWEEN 1500 AND 3000;</code>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">3. 查询10部门20部门的所有员工</h4>
                        <div class="flex flex-col md:flex-row gap-4">
                            <div class="flex-1">
                                <h5 class="text-lg font-medium mb-2 text-gray-600">方式一: OR条件</h5>
                                <div class="sql-code p-4 rounded">
                                    <code>SELECT * FROM emp WHERE deptno = 10 OR deptno = 20;</code>
                                </div>
                            </div>
                            <div class="flex-1">
                                <h5 class="text-lg font-medium mb-2 text-gray-600">方式二: IN条件</h5>
                                <div class="sql-code p-4 rounded">
                                    <code>SELECT * FROM emp WHERE deptno IN (10, 20);</code>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">4. 模糊查询</h4>
                        <div class="flex flex-col md:flex-row gap-4">
                            <div class="flex-1">
                                <h5 class="text-lg font-medium mb-2 text-gray-600">以M开头的员工</h5>
                                <div class="sql-code p-4 rounded">
                                    <code>SELECT * FROM emp WHERE ename LIKE 'M%';</code>
                                </div>
                            </div>
                            <div class="flex-1">
                                <h5 class="text-lg font-medium mb-2 text-gray-600">不以M开头的员工</h5>
                                <div class="sql-code p-4 rounded">
                                    <code>SELECT * FROM emp WHERE ename NOT LIKE 'M%';</code>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Multi-table Queries -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-6 border-b border-gray-100 bg-gradient-to-r from-blue-50 to-blue-100">
                    <h3 class="text-2xl font-bold text-blue-700 flex items-center">
                        <i class="fas fa-project-diagram mr-3"></i>
                        多表查询
                    </h3>
                </div>
                <div class="p-6">
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">1. 消除笛卡尔积</h4>
                        <div class="sql-code p-4 rounded mb-4">
                            <code>SELECT * FROM emp, dept WHERE emp.deptno = dept.deptno;</code>
                        </div>
                        <p class="text-gray-600 mt-2">
                            未加关联条件会产生笛卡尔积(14×4=56条数据)，添加关联条件后消除(14条数据)
                        </p>
                    </div>
                    
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">2. 连接查询</h4>
                        
                        <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                            <div class="bg-gray-50 p-4 rounded-lg">
                                <h5 class="text-lg font-medium mb-2 text-gray-700">自连接</h5>
                                <div class="sql-code p-4 rounded mb-2">
                                    <code>SELECT e1.empno, e1.ename, e1.mgr, e2.ename AS mgr_name<br>FROM emp e1, emp e2<br>WHERE e1.mgr = e2.empno(+);</code>
                                </div>
                                <p class="text-sm text-gray-600">
                                    <span class="highlight">(+)</span>放在等号右边表示左连接，放在左边表示右连接
                                </p>
                            </div>
                            
                            <div class="bg-gray-50 p-4 rounded-lg">
                                <h5 class="text-lg font-medium mb-2 text-gray-700">右连接</h5>
                                <div class="sql-code p-4 rounded">
                                    <code>SELECT e.empno, e.ename, d.deptno, d.dname<br>FROM emp e, dept d<br>WHERE e.deptno(+) = d.deptno;</code>
                                </div>
                            </div>
                        </div>
                    </div>
                    
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">3. 结果集合并</h4>
                        <div class="flex flex-col md:flex-row gap-4">
                            <div class="flex-1">
                                <h5 class="text-lg font-medium mb-2 text-gray-600">UNION</h5>
                                <div class="sql-code p-4 rounded">
                                    <code>SELECT * FROM emp WHERE deptno = 10<br>UNION<br>SELECT * FROM emp WHERE deptno = 20;</code>
                                </div>
                                <p class="text-sm text-gray-600 mt-2">返回结果全部内容，重复数据不显示</p>
                            </div>
                            <div class="flex-1">
                                <h5 class="text-lg font-medium mb-2 text-gray-600">UNION ALL</h5>
                                <div class="sql-code p-4 rounded">
                                    <code>SELECT * FROM emp WHERE deptno = 10<br>UNION ALL<br>SELECT * FROM emp WHERE deptno = 20;</code>
                                </div>
                                <p class="text-sm text-gray-600 mt-2">返回结果全部内容，重复数据也会显示</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- Functions Section -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 section-title">常用函数</h2>
            
            <!-- Character Functions -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-6 border-b border-gray-100 bg-gradient-to-r from-purple-50 to-purple-100">
                    <h3 class="text-2xl font-bold text-purple-700 flex items-center">
                        <i class="fas fa-font mr-3"></i>
                        字符函数
                    </h3>
                </div>
                <div class="p-6">
                    <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-purple-600">UPPER</h4>
                            <p class="text-gray-600 text-sm mb-2">将字符串转为大写</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT UPPER('oracle') FROM dual;</code>
                            </div>
                        </div>
                        
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-purple-600">LOWER</h4>
                            <p class="text-gray-600 text-sm mb-2">将字符串转为小写</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT LOWER('ORACLE') FROM dual;</code>
                            </div>
                        </div>
                        
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-purple-600">INITCAP</h4>
                            <p class="text-gray-600 text-sm mb-2">首字母大写</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT INITCAP('oracle') FROM dual;</code>
                            </div>
                        </div>
                        
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-purple-600">SUBSTR</h4>
                            <p class="text-gray-600 text-sm mb-2">截取字符串</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT SUBSTR('Oracle', 2, 3) FROM dual;</code>
                            </div>
                        </div>
                        
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-purple-600">REPLACE</h4>
                            <p class="text-gray-600 text-sm mb-2">字符串替换</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT REPLACE('Oracle', 'a', 'A') FROM dual;</code>
                            </div>
                        </div>
                        
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-purple-600">INSTR</h4>
                            <p class="text-gray-600 text-sm mb-2">查找字符索引</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT INSTR('Oracle', 'a') FROM dual;</code>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Numeric Functions -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-6 border-b border-gray-100 bg-gradient-to-r from-blue-50 to-blue-100">
                    <h3 class="text-2xl font-bold text-blue-700 flex items-center">
                        <i class="fas fa-calculator mr-3"></i>
                        数值函数
                    </h3>
                </div>
                <div class="p-6">
                    <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-blue-600">ROUND</h4>
                            <p class="text-gray-600 text-sm mb-2">四舍五入</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT ROUND(45.926, 2) FROM dual;</code>
                            </div>
                        </div>
                        
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-blue-600">TRUNC</h4>
                            <p class="text-gray-600 text-sm mb-2">截取指定位数</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT TRUNC(45.926, 2) FROM dual;</code>
                            </div>
                        </div>
                        
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-blue-600">MOD</h4>
                            <p class="text-gray-600 text-sm mb-2">取模运算</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT MOD(10, 3) FROM dual;</code>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Date Functions -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-6 border-b border-gray-100 bg-gradient-to-r from-green-50 to-green-100">
                    <h3 class="text-2xl font-bold text-green-700 flex items-center">
                        <i class="far fa-calendar-alt mr-3"></i>
                        日期函数
                    </h3>
                </div>
                <div class="p-6">
                    <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-green-600">SYSDATE</h4>
                            <p class="text-gray-600 text-sm mb-2">获取系统当前日期</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT SYSDATE FROM dual;</code>
                            </div>
                        </div>
                        
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-green-600">ADD_MONTHS</h4>
                            <p class="text-gray-600 text-sm mb-2">日期加减月份</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT ADD_MONTHS(SYSDATE, 3) FROM dual;</code>
                            </div>
                        </div>
                        
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-green-600">MONTHS_BETWEEN</h4>
                            <p class="text-gray-600 text-sm mb-2">计算月间隔</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT MONTHS_BETWEEN('01-SEP-95','11-JAN-94') FROM dual;</code>
                            </div>
                        </div>
                        
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-green-600">LAST_DAY</h4>
                            <p class="text-gray-600 text-sm mb-2">获取月份最后一天</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT LAST_DAY(SYSDATE) FROM dual;</code>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Conversion Functions -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-6 border-b border-gray-100 bg-gradient-to-r from-red-50 to-red-100">
                    <h3 class="text-2xl font-bold text-red-700 flex items-center">
                        <i class="fas fa-exchange-alt mr-3"></i>
                        转换函数
                    </h3>
                </div>
                <div class="p-6">
                    <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-red-600">TO_CHAR</h4>
                            <p class="text-gray-600 text-sm mb-2">格式化日期/数字</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS') FROM dual;</code>
                            </div>
                        </div>
                        
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-red-600">TO_DATE</h4>
                            <p class="text-gray-600 text-sm mb-2">字符串转日期</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT TO_DATE('2022-05-20', 'YYYY-MM-DD') FROM dual;</code>
                            </div>
                        </div>
                        
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-red-600">TO_NUMBER</h4>
                            <p class="text-gray-600 text-sm mb-2">字符串转数字</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT TO_NUMBER('100') FROM dual;</code>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- General Functions -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-6 border-b border-gray-100 bg-gradient-to-r from-yellow-50 to-yellow-100">
                    <h3 class="text-2xl font-bold text-yellow-700 flex items-center">
                        <i class="fas fa-star mr-3"></i>
                        通用函数
                    </h3>
                </div>
                <div class="p-6">
                    <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-yellow-600">NVL</h4>
                            <p class="text-gray-600 text-sm mb-2">空值处理</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT NVL(comm, 0) FROM emp;</code>
                            </div>
                        </div>
                        
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-yellow-600">DECODE</h4>
                            <p class="text-gray-600 text-sm mb-2">条件判断</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT DECODE(grade,1,'A',2,'B','C') FROM salgrade;</code>
                            </div>
                        </div>
                        
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-yellow-600">CASE</h4>
                            <p class="text-gray-600 text-sm mb-2">多条件判断</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT CASE WHEN sal > 3000 THEN '高' ELSE '低' END FROM emp;</code>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- Aggregate Functions -->
            <div class="bg-white rounded-xl shadow-md overflow-hidden">
                <div class="p-6 border-b border-gray-100 bg-gradient-to-r from-indigo-50 to-indigo-100">
                    <h3 class="text-2xl font-bold text-indigo-700 flex items-center">
                        <i class="fas fa-chart-bar mr-3"></i>
                        统计函数
                    </h3>
                </div>
                <div class="p-6">
                    <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-indigo-600">COUNT</h4>
                            <p class="text-gray-600 text-sm mb-2">记录数统计</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT COUNT(*) FROM emp;</code>
                            </div>
                        </div>
                        
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-indigo-600">SUM/AVG</h4>
                            <p class="text-gray-600 text-sm mb-2">求和/平均值</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT SUM(sal), AVG(sal) FROM emp;</code>
                            </div>
                        </div>
                        
                        <div class="function-card bg-gray-50 p-4 rounded-lg">
                            <h4 class="text-lg font-medium text-indigo-600">MAX/MIN</h4>
                            <p class="text-gray-600 text-sm mb-2">最大值/最小值</p>
                            <div class="sql-code p-3 rounded text-sm">
                                <code>SELECT MAX(sal), MIN(sal) FROM emp;</code>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- Grouping Section -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 section-title">分组统计</h2>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8">
                <div class="p-6 border-b border-gray-100 bg-gradient-to-r from-purple-50 to-purple-100">
                    <h3 class="text-2xl font-bold text-purple-700 flex items-center">
                        <i class="fas fa-layer-group mr-3"></i>
                        分组查询
                    </h3>
                </div>
                <div class="p-6">
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">1. 单字段分组</h4>
                        <div class="sql-code p-4 rounded mb-4">
                            <code>SELECT deptno, COUNT(*), AVG(sal)<br>FROM emp<br>GROUP BY deptno;</code>
                        </div>
                    </div>
                    
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">2. 多字段分组</h4>
                        <div class="sql-code p-4 rounded mb-4">
                            <code>SELECT d.deptno, d.dname, COUNT(*), AVG(e.sal)<br>FROM emp e, dept d<br>WHERE e.deptno = d.deptno<br>GROUP BY d.deptno, d.dname;</code>
                        </div>
                    </div>
                    
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">3. HAVING条件过滤</h4>
                        <div class="sql-code p-4 rounded mb-4">
                            <code>SELECT deptno, AVG(sal)<br>FROM emp<br>GROUP BY deptno<br>HAVING AVG(sal) > 2000;</code>
                        </div>
                        <p class="text-gray-600">
                            <span class="highlight">WHERE</span>在分组前过滤，<span class="highlight">HAVING</span>在分组后过滤
                        </p>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- Subqueries Section -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 section-title">子查询</h2>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden">
                <div class="p-6 border-b border-gray-100 bg-gradient-to-r from-blue-50 to-blue-100">
                    <h3 class="text-2xl font-bold text-blue-700 flex items-center">
                        <i class="fas fa-code-branch mr-3"></i>
                        子查询应用
                    </h3>
                </div>
                <div class="p-6">
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">1. WHERE子句中的子查询</h4>
                        <div class="sql-code p-4 rounded mb-4">
                            <code>SELECT * FROM emp<br>WHERE sal > (SELECT sal FROM emp WHERE ename = 'ALLEN');</code>
                        </div>
                    </div>
                    
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">2. FROM子句中的子查询</h4>
                        <div class="sql-code p-4 rounded mb-4">
                            <code>SELECT d.deptno, d.dname, temp.count, temp.avg_sal<br>FROM dept d, (<br>  SELECT deptno, COUNT(*) count, AVG(sal) avg_sal<br>  FROM emp<br>  GROUP BY deptno<br>) temp<br>WHERE d.deptno = temp.deptno(+);</code>
                        </div>
                    </div>
                    
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">3. SELECT子句中的子查询</h4>
                        <div class="sql-code p-4 rounded mb-4">
                            <code>SELECT e.empno, e.ename,<br>  (SELECT d.dname FROM dept d WHERE d.deptno = e.deptno) dname<br>FROM emp e;</code>
                        </div>
                    </div>
                    
                    <div class="mb-8">
                        <h4 class="text-xl font-semibold mb-4 text-gray-700">4. WITH子句创建临时表</h4>
                        <div class="sql-code p-4 rounded">
                            <code>WITH temp AS (<br>  SELECT deptno, COUNT(*) count, AVG(sal) avg_sal<br>  FROM emp<br>  GROUP BY deptno<br>)<br>SELECT d.deptno, d.dname, temp.count, temp.avg_sal<br>FROM dept d, temp<br>WHERE d.deptno = temp.deptno(+);</code>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        
        <!-- Data Visualization -->
        <section class="mb-16">
            <h2 class="text-3xl font-bold mb-8 text-gray-800 section-title">数据关系可视化</h2>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden">
                <div class="p-6 border-b border-gray-100 bg-gradient-to-r from-green-50 to-green-100">
                    <h3 class="text-2xl font-bold text-green-700 flex items-center">
                        <i class="fas fa-chart-pie mr-3"></i>
                        SCOTT数据库关系图
                    </h3>
                </div>
                <div class="p-6">
                    <div class="mermaid">
                        erDiagram
                            DEPT ||--o{ EMP : "1:N"
                            EMP ||--|{ SALGRADE : "N:1"
                            EMP ||--o{ BONUS : "1:N"
                            
                            DEPT {
                                number DEPTNO PK
                                string DNAME
                                string LOC
                            }
                            
                            EMP {
                                number EMPNO PK
                                string ENAME
                                string JOB
                                number MGR FK
                                date HIREDATE
                                number SAL
                                number COMM
                                number DEPTNO FK
                            }
                            
                            SALGRADE {
                                number GRADE PK
                                number LOSAL
                                number HISAL
                            }
                            
                            BONUS {
                                string ENAME
                                string JOB
                                number SAL
                                number COMM
                            }
                    </div>
                </div>
            </div>
        </section>
    </div>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: false,
                htmlLabels: true
            },
            er: {
                diagramPadding: 20,
                layoutDirection: 'TB',
                useMaxWidth: false
            }
        });
    </script>
</body>
</html>
```